package com.hnevc.xiewenguang;

import java.io.File;

public class Example04 {

    public static void main(String[] args) {

        File file = new File("text.txt");
        System.out.println("文件名称：" + file.getName());
        System.out.println("文件相对路径" + file.getPath());
        System.out.println("文件的绝对路径" + file.getAbsolutePath());
        System.out.println("文件的父路径" +file.getParent());
        System.out.println("判断文件是否可读" +( file.canRead()? "文件可读":"文件不可读"));
        System.out.println("判断件是否可写" +( file.canWrite()? "文件可写":"文件不可写"));
        System.out.println("最后修改时间" + file.lastModified());
        System.out.println("文件大小" + file.length() + "B");
    }
}
